#include<stdio.h>

int main()
{
	//freopen("D://input.txt", "r", stdin);
	int n, d, k;
	float e;
	scanf("%d %f %d", &n, &e, &d);
	
	int maybeEmpty = 0, mustEmpty = 0;
	for(int i = 0; i < n; i ++)
	{
		scanf("%d", &k);
		int count = 0;
		for(int j = 0; j < k; j ++)
		{
			float tmp;
			scanf("%f", &tmp);
			
			if(tmp < e)
				count ++;
		}
		
		if(count*2 > k && k > d)
			mustEmpty ++;
		if(count*2 > k && k <= d)
			maybeEmpty ++;
	}
	printf("%.1f%% %.1f%%\n", 100.0*maybeEmpty/n, 100.0*mustEmpty/n);
	return 0;
}
